
'===============================================================================
'  Generated From - VbNet_SQL_dOOdads_BusinessEntity.vbgen
' 
'  ** IMPORTANT  **
'  How to Generate your stored procedures:
' 
'  SQL        = SQL_StoredProcs.vbgen
'  ACCESS     = Access_StoredProcs.vbgen
'  ORACLE     = Oracle_StoredProcs.vbgen
'  FIREBIRD   = FirebirdStoredProcs.vbgen
'  POSTGRESQL = PostgreSQL_StoredProcs.vbgen
'
'  The supporting base class SqlClientEntity is in the Architecture directory in "dOOdads".
'  
'  This object is 'MustInherit' which means you need to inherit from it to be able
'  to instantiate it.  This is very easilly done. You can Override properties and
'  methods in your derived class, this allows you to regenerate this class at any
'  time and not worry about overwriting custom code. 
'
'  NEVER EDIT THIS FILE.
'
'  Public Class YourObject
'    Inherits _YourObject
'
'  End Class
'
'===============================================================================

' Generated by MyGeneration Version # (1.3.0.3)

Imports System
Imports System.Data
Imports System.Data.SqlClient
Imports System.Collections
Imports System.Collections.Specialized

Imports MyGeneration.dOOdads

NameSpace Class_RC

Public MustInherit Class _COBROS
	Inherits SqlClientEntity

		Public Sub New() 
			Me.QuerySource = "COBROS"
			Me.MappingName = "COBROS"
		End Sub

	'=================================================================
	'  Public Overrides Sub AddNew()
	'=================================================================
	'
	'=================================================================
	Public Overrides Sub AddNew()
		MyBase.AddNew()
				
	End Sub
	
	Public Overrides Sub FlushData()
		Me._whereClause = nothing
		Me._aggregateClause = nothing		
		MyBase.FlushData()
	End Sub
	
		
	'=================================================================
	'  	Public Function LoadAll() As Boolean
	'=================================================================
	'  Loads all of the records in the database, and sets the currentRow to the first row
	'=================================================================
	Public Function LoadAll() As Boolean
	
		Dim parameters As ListDictionary = Nothing
		
		
    	Return MyBase.LoadFromSql("[" + Me.SchemaStoredProcedure + "proc_COBROSLoadAll]", parameters)
		
	End Function

	'=================================================================
	' Public Overridable Function LoadByPrimaryKey()  As Boolean
	'=================================================================
	'  Loads a single row of via the primary key
	'=================================================================
        Public Overridable Function LoadByPrimaryKey(ByVal CodCobro As Integer) As Boolean

            Dim parameters As ListDictionary = New ListDictionary()
            parameters.Add(_COBROS.Parameters.CodCobro, CodCobro)


            Return MyBase.LoadFromSql("[" + Me.SchemaStoredProcedure + "proc_COBROSLoadByPrimaryKey]", parameters)

        End Function

#Region "Parameters"
        Protected Class Parameters

            Public Shared ReadOnly Property CodCobro As SqlParameter
                Get
                    Return New SqlParameter("@CodCobro", SqlDbType.Int, 0)
                End Get
            End Property

            Public Shared ReadOnly Property FechaCobro As SqlParameter
                Get
                    Return New SqlParameter("@FechaCobro", SqlDbType.DateTime, 0)
                End Get
            End Property

            Public Shared ReadOnly Property CodCliente As SqlParameter
                Get
                    Return New SqlParameter("@CodCliente", SqlDbType.Int, 0)
                End Get
            End Property

            Public Shared ReadOnly Property NroRecibo As SqlParameter
                Get
                    Return New SqlParameter("@NroRecibo", SqlDbType.NVarChar, 50)
                End Get
            End Property

            Public Shared ReadOnly Property Total As SqlParameter
                Get
                    Return New SqlParameter("@Total", SqlDbType.Decimal, 0)
                End Get
            End Property

            Public Shared ReadOnly Property EstadRecibo As SqlParameter
                Get
                    Return New SqlParameter("@EstadRecibo", SqlDbType.NVarChar, 50)
                End Get
            End Property

            Public Shared ReadOnly Property CodCobrador As SqlParameter
                Get
                    Return New SqlParameter("@CodCobrador", SqlDbType.Int, 0)
                End Get
            End Property

            Public Shared ReadOnly Property CodUsuario As SqlParameter
                Get
                    Return New SqlParameter("@CodUsuario", SqlDbType.Int, 0)
                End Get
            End Property

            Public Shared ReadOnly Property FechaActualizacion As SqlParameter
                Get
                    Return New SqlParameter("@FechaActualizacion", SqlDbType.DateTime, 0)
                End Get
            End Property

        End Class
#End Region

#Region "ColumnNames"
        Public Class ColumnNames

            Public Const CodCobro As String = "codCobro"
            Public Const FechaCobro As String = "fechaCobro"
            Public Const CodCliente As String = "codCliente"
            Public Const NroRecibo As String = "nroRecibo"
            Public Const Total As String = "total"
            Public Const EstadRecibo As String = "estadRecibo"
            Public Const CodCobrador As String = "codCobrador"
            Public Const CodUsuario As String = "codUsuario"
            Public Const FechaActualizacion As String = "fechaActualizacion"

            Public Shared Function ToPropertyName(ByVal columnName As String) As String

                If ht Is Nothing Then

                    ht = New Hashtable

                    ht(CodCobro) = _COBROS.PropertyNames.CodCobro
                    ht(FechaCobro) = _COBROS.PropertyNames.FechaCobro
                    ht(CodCliente) = _COBROS.PropertyNames.CodCliente
                    ht(NroRecibo) = _COBROS.PropertyNames.NroRecibo
                    ht(Total) = _COBROS.PropertyNames.Total
                    ht(EstadRecibo) = _COBROS.PropertyNames.EstadRecibo
                    ht(CodCobrador) = _COBROS.PropertyNames.CodCobrador
                    ht(CodUsuario) = _COBROS.PropertyNames.CodUsuario
                    ht(FechaActualizacion) = _COBROS.PropertyNames.FechaActualizacion

                End If

                Return CType(ht(columnName), String)

            End Function

            Private Shared ht As Hashtable = Nothing
        End Class
#End Region

#Region "PropertyNames"
        Public Class PropertyNames

            Public Const CodCobro As String = "CodCobro"
            Public Const FechaCobro As String = "FechaCobro"
            Public Const CodCliente As String = "CodCliente"
            Public Const NroRecibo As String = "NroRecibo"
            Public Const Total As String = "Total"
            Public Const EstadRecibo As String = "EstadRecibo"
            Public Const CodCobrador As String = "CodCobrador"
            Public Const CodUsuario As String = "CodUsuario"
            Public Const FechaActualizacion As String = "FechaActualizacion"

            Public Shared Function ToColumnName(ByVal propertyName As String) As String

                If ht Is Nothing Then

                    ht = New Hashtable

                    ht(CodCobro) = _COBROS.ColumnNames.CodCobro
                    ht(FechaCobro) = _COBROS.ColumnNames.FechaCobro
                    ht(CodCliente) = _COBROS.ColumnNames.CodCliente
                    ht(NroRecibo) = _COBROS.ColumnNames.NroRecibo
                    ht(Total) = _COBROS.ColumnNames.Total
                    ht(EstadRecibo) = _COBROS.ColumnNames.EstadRecibo
                    ht(CodCobrador) = _COBROS.ColumnNames.CodCobrador
                    ht(CodUsuario) = _COBROS.ColumnNames.CodUsuario
                    ht(FechaActualizacion) = _COBROS.ColumnNames.FechaActualizacion

                End If

                Return CType(ht(propertyName), String)

            End Function

            Private Shared ht As Hashtable = Nothing

        End Class
#End Region

#Region "StringPropertyNames"
        Public Class StringPropertyNames

            Public Const CodCobro As String = "s_CodCobro"
            Public Const FechaCobro As String = "s_FechaCobro"
            Public Const CodCliente As String = "s_CodCliente"
            Public Const NroRecibo As String = "s_NroRecibo"
            Public Const Total As String = "s_Total"
            Public Const EstadRecibo As String = "s_EstadRecibo"
            Public Const CodCobrador As String = "s_CodCobrador"
            Public Const CodUsuario As String = "s_CodUsuario"
            Public Const FechaActualizacion As String = "s_FechaActualizacion"

        End Class
#End Region

#Region "Properties"
        Public Overridable Property CodCobro As Integer
            Get
                Return MyBase.Getint(ColumnNames.CodCobro)
            End Get
            Set(ByVal Value As Integer)
                MyBase.Setint(ColumnNames.CodCobro, Value)
            End Set
        End Property

        Public Overridable Property FechaCobro As DateTime
            Get
                Return MyBase.GetDateTime(ColumnNames.FechaCobro)
            End Get
            Set(ByVal Value As DateTime)
                MyBase.SetDateTime(ColumnNames.FechaCobro, Value)
            End Set
        End Property

        Public Overridable Property CodCliente As Integer
            Get
                Return MyBase.Getint(ColumnNames.CodCliente)
            End Get
            Set(ByVal Value As Integer)
                MyBase.Setint(ColumnNames.CodCliente, Value)
            End Set
        End Property

        Public Overridable Property NroRecibo As String
            Get
                Return MyBase.Getstring(ColumnNames.NroRecibo)
            End Get
            Set(ByVal Value As String)
                MyBase.Setstring(ColumnNames.NroRecibo, Value)
            End Set
        End Property

        Public Overridable Property Total As Decimal
            Get
                Return MyBase.Getdecimal(ColumnNames.Total)
            End Get
            Set(ByVal Value As Decimal)
                MyBase.Setdecimal(ColumnNames.Total, Value)
            End Set
        End Property

        Public Overridable Property EstadRecibo As String
            Get
                Return MyBase.Getstring(ColumnNames.EstadRecibo)
            End Get
            Set(ByVal Value As String)
                MyBase.Setstring(ColumnNames.EstadRecibo, Value)
            End Set
        End Property

        Public Overridable Property CodCobrador As Integer
            Get
                Return MyBase.Getint(ColumnNames.CodCobrador)
            End Get
            Set(ByVal Value As Integer)
                MyBase.Setint(ColumnNames.CodCobrador, Value)
            End Set
        End Property

        Public Overridable Property CodUsuario As Integer
            Get
                Return MyBase.Getint(ColumnNames.CodUsuario)
            End Get
            Set(ByVal Value As Integer)
                MyBase.Setint(ColumnNames.CodUsuario, Value)
            End Set
        End Property

        Public Overridable Property FechaActualizacion As DateTime
            Get
                Return MyBase.GetDateTime(ColumnNames.FechaActualizacion)
            End Get
            Set(ByVal Value As DateTime)
                MyBase.SetDateTime(ColumnNames.FechaActualizacion, Value)
            End Set
        End Property


#End Region
	
	#Region "String Properties" 

		Public Overridable Property s_CodCobro As String
			Get
				If Me.IsColumnNull(ColumnNames.CodCobro) Then
					Return String.Empty
				Else
					Return MyBase.GetintAsString(ColumnNames.CodCobro)
				End If
			End Get
			Set(ByVal Value As String)
				If String.Empty = value Then
					Me.SetColumnNull(ColumnNames.CodCobro)
				Else
					Me.CodCobro = MyBase.SetintAsString(ColumnNames.CodCobro, Value)
				End If
			End Set
		End Property

		Public Overridable Property s_FechaCobro As String
			Get
				If Me.IsColumnNull(ColumnNames.FechaCobro) Then
					Return String.Empty
				Else
					Return MyBase.GetDateTimeAsString(ColumnNames.FechaCobro)
				End If
			End Get
			Set(ByVal Value As String)
				If String.Empty = value Then
					Me.SetColumnNull(ColumnNames.FechaCobro)
				Else
					Me.FechaCobro = MyBase.SetDateTimeAsString(ColumnNames.FechaCobro, Value)
				End If
			End Set
		End Property

		Public Overridable Property s_CodCliente As String
			Get
				If Me.IsColumnNull(ColumnNames.CodCliente) Then
					Return String.Empty
				Else
					Return MyBase.GetintAsString(ColumnNames.CodCliente)
				End If
			End Get
			Set(ByVal Value As String)
				If String.Empty = value Then
					Me.SetColumnNull(ColumnNames.CodCliente)
				Else
					Me.CodCliente = MyBase.SetintAsString(ColumnNames.CodCliente, Value)
				End If
			End Set
		End Property

		Public Overridable Property s_NroRecibo As String
			Get
				If Me.IsColumnNull(ColumnNames.NroRecibo) Then
					Return String.Empty
				Else
					Return MyBase.GetstringAsString(ColumnNames.NroRecibo)
				End If
			End Get
			Set(ByVal Value As String)
				If String.Empty = value Then
					Me.SetColumnNull(ColumnNames.NroRecibo)
				Else
					Me.NroRecibo = MyBase.SetstringAsString(ColumnNames.NroRecibo, Value)
				End If
			End Set
		End Property

		Public Overridable Property s_Total As String
			Get
				If Me.IsColumnNull(ColumnNames.Total) Then
					Return String.Empty
				Else
					Return MyBase.GetdecimalAsString(ColumnNames.Total)
				End If
			End Get
			Set(ByVal Value As String)
				If String.Empty = value Then
					Me.SetColumnNull(ColumnNames.Total)
				Else
					Me.Total = MyBase.SetdecimalAsString(ColumnNames.Total, Value)
				End If
			End Set
		End Property

		Public Overridable Property s_EstadRecibo As String
			Get
				If Me.IsColumnNull(ColumnNames.EstadRecibo) Then
					Return String.Empty
				Else
					Return MyBase.GetstringAsString(ColumnNames.EstadRecibo)
				End If
			End Get
			Set(ByVal Value As String)
				If String.Empty = value Then
					Me.SetColumnNull(ColumnNames.EstadRecibo)
				Else
					Me.EstadRecibo = MyBase.SetstringAsString(ColumnNames.EstadRecibo, Value)
				End If
			End Set
		End Property

		Public Overridable Property s_CodCobrador As String
			Get
				If Me.IsColumnNull(ColumnNames.CodCobrador) Then
					Return String.Empty
				Else
					Return MyBase.GetintAsString(ColumnNames.CodCobrador)
				End If
			End Get
			Set(ByVal Value As String)
				If String.Empty = value Then
					Me.SetColumnNull(ColumnNames.CodCobrador)
				Else
					Me.CodCobrador = MyBase.SetintAsString(ColumnNames.CodCobrador, Value)
				End If
			End Set
		End Property

		Public Overridable Property s_CodUsuario As String
			Get
				If Me.IsColumnNull(ColumnNames.CodUsuario) Then
					Return String.Empty
				Else
					Return MyBase.GetintAsString(ColumnNames.CodUsuario)
				End If
			End Get
			Set(ByVal Value As String)
				If String.Empty = value Then
					Me.SetColumnNull(ColumnNames.CodUsuario)
				Else
					Me.CodUsuario = MyBase.SetintAsString(ColumnNames.CodUsuario, Value)
				End If
			End Set
		End Property

		Public Overridable Property s_FechaActualizacion As String
			Get
				If Me.IsColumnNull(ColumnNames.FechaActualizacion) Then
					Return String.Empty
				Else
					Return MyBase.GetDateTimeAsString(ColumnNames.FechaActualizacion)
				End If
			End Get
			Set(ByVal Value As String)
				If String.Empty = value Then
					Me.SetColumnNull(ColumnNames.FechaActualizacion)
				Else
					Me.FechaActualizacion = MyBase.SetDateTimeAsString(ColumnNames.FechaActualizacion, Value)
				End If
			End Set
		End Property


	#End Region  	

	#Region "Where Clause"
    Public Class WhereClause

        Public Sub New(ByVal entity As BusinessEntity)
            Me._entity = entity
        End Sub
		
		Public ReadOnly Property TearOff As TearOffWhereParameter
			Get
				If _tearOff Is Nothing Then
					_tearOff = new TearOffWhereParameter(Me)
				End If

				Return _tearOff
			End Get
		End Property

		#Region "TearOff's"
		Public class TearOffWhereParameter

			Public Sub New(ByVal clause As WhereClause)
				Me._clause = clause
			End Sub
		
	
			Public ReadOnly Property CodCobro() As WhereParameter
				Get
					Dim where As WhereParameter = New WhereParameter(ColumnNames.CodCobro, Parameters.CodCobro)
                        Me._clause._entity.Query.AddWhereParameter(where)
                        Return where
                    End Get
                End Property

                Public ReadOnly Property FechaCobro() As WhereParameter
                    Get
                        Dim where As WhereParameter = New WhereParameter(ColumnNames.FechaCobro, Parameters.FechaCobro)
                        Me._clause._entity.Query.AddWhereParameter(where)
                        Return where
                    End Get
                End Property

                Public ReadOnly Property CodCliente() As WhereParameter
                    Get
                        Dim where As WhereParameter = New WhereParameter(ColumnNames.CodCliente, Parameters.CodCliente)
                        Me._clause._entity.Query.AddWhereParameter(where)
                        Return where
                    End Get
                End Property

                Public ReadOnly Property NroRecibo() As WhereParameter
                    Get
                        Dim where As WhereParameter = New WhereParameter(ColumnNames.NroRecibo, Parameters.NroRecibo)
                        Me._clause._entity.Query.AddWhereParameter(where)
                        Return where
                    End Get
                End Property

                Public ReadOnly Property Total() As WhereParameter
                    Get
                        Dim where As WhereParameter = New WhereParameter(ColumnNames.Total, Parameters.Total)
                        Me._clause._entity.Query.AddWhereParameter(where)
                        Return where
                    End Get
                End Property

                Public ReadOnly Property EstadRecibo() As WhereParameter
                    Get
                        Dim where As WhereParameter = New WhereParameter(ColumnNames.EstadRecibo, Parameters.EstadRecibo)
                        Me._clause._entity.Query.AddWhereParameter(where)
                        Return where
                    End Get
                End Property

                Public ReadOnly Property CodCobrador() As WhereParameter
                    Get
                        Dim where As WhereParameter = New WhereParameter(ColumnNames.CodCobrador, Parameters.CodCobrador)
                        Me._clause._entity.Query.AddWhereParameter(where)
                        Return where
                    End Get
                End Property

                Public ReadOnly Property CodUsuario() As WhereParameter
                    Get
                        Dim where As WhereParameter = New WhereParameter(ColumnNames.CodUsuario, Parameters.CodUsuario)
                        Me._clause._entity.Query.AddWhereParameter(where)
                        Return where
                    End Get
                End Property

                Public ReadOnly Property FechaActualizacion() As WhereParameter
                    Get
                        Dim where As WhereParameter = New WhereParameter(ColumnNames.FechaActualizacion, Parameters.FechaActualizacion)
                        Me._clause._entity.Query.AddWhereParameter(where)
                        Return where
                    End Get
                End Property


			Private _clause as WhereClause
		End Class
		#End Region	

		Public ReadOnly Property CodCobro() As WhereParameter 
			Get
				If _CodCobro_W Is Nothing Then
					_CodCobro_W = TearOff.CodCobro
				End If
				Return _CodCobro_W
			End Get
		End Property

		Public ReadOnly Property FechaCobro() As WhereParameter 
			Get
				If _FechaCobro_W Is Nothing Then
					_FechaCobro_W = TearOff.FechaCobro
				End If
				Return _FechaCobro_W
			End Get
		End Property

		Public ReadOnly Property CodCliente() As WhereParameter 
			Get
				If _CodCliente_W Is Nothing Then
					_CodCliente_W = TearOff.CodCliente
				End If
				Return _CodCliente_W
			End Get
		End Property

		Public ReadOnly Property NroRecibo() As WhereParameter 
			Get
				If _NroRecibo_W Is Nothing Then
					_NroRecibo_W = TearOff.NroRecibo
				End If
				Return _NroRecibo_W
			End Get
		End Property

		Public ReadOnly Property Total() As WhereParameter 
			Get
				If _Total_W Is Nothing Then
					_Total_W = TearOff.Total
				End If
				Return _Total_W
			End Get
		End Property

		Public ReadOnly Property EstadRecibo() As WhereParameter 
			Get
				If _EstadRecibo_W Is Nothing Then
					_EstadRecibo_W = TearOff.EstadRecibo
				End If
				Return _EstadRecibo_W
			End Get
		End Property

		Public ReadOnly Property CodCobrador() As WhereParameter 
			Get
				If _CodCobrador_W Is Nothing Then
					_CodCobrador_W = TearOff.CodCobrador
				End If
				Return _CodCobrador_W
			End Get
		End Property

		Public ReadOnly Property CodUsuario() As WhereParameter 
			Get
				If _CodUsuario_W Is Nothing Then
					_CodUsuario_W = TearOff.CodUsuario
				End If
				Return _CodUsuario_W
			End Get
		End Property

		Public ReadOnly Property FechaActualizacion() As WhereParameter 
			Get
				If _FechaActualizacion_W Is Nothing Then
					_FechaActualizacion_W = TearOff.FechaActualizacion
				End If
				Return _FechaActualizacion_W
			End Get
		End Property

		Private _CodCobro_W As WhereParameter = Nothing
		Private _FechaCobro_W As WhereParameter = Nothing
		Private _CodCliente_W As WhereParameter = Nothing
		Private _NroRecibo_W As WhereParameter = Nothing
		Private _Total_W As WhereParameter = Nothing
		Private _EstadRecibo_W As WhereParameter = Nothing
		Private _CodCobrador_W As WhereParameter = Nothing
		Private _CodUsuario_W As WhereParameter = Nothing
		Private _FechaActualizacion_W As WhereParameter = Nothing

			Public Sub WhereClauseReset()

			_CodCobro_W = Nothing
			_FechaCobro_W = Nothing
			_CodCliente_W = Nothing
			_NroRecibo_W = Nothing
			_Total_W = Nothing
			_EstadRecibo_W = Nothing
			_CodCobrador_W = Nothing
			_CodUsuario_W = Nothing
			_FechaActualizacion_W = Nothing
				Me._entity.Query.FlushWhereParameters()

			End Sub
	
		Private _entity As BusinessEntity
		Private _tearOff As TearOffWhereParameter
    End Class	

	Public ReadOnly Property Where() As WhereClause
		Get
			If _whereClause Is Nothing Then
				_whereClause = New WhereClause(Me)
			End If
	
			Return _whereClause
		End Get
	End Property
	
	Private _whereClause As WhereClause = Nothing	
#End Region	

#Region "Aggregate Clause"
    Public Class AggregateClause

        Public Sub New(ByVal entity As BusinessEntity)
            Me._entity = entity
        End Sub
		
		Public ReadOnly Property TearOff As TearOffAggregateParameter
			Get
				If _tearOff Is Nothing Then
					_tearOff = new TearOffAggregateParameter(Me)
				End If

				Return _tearOff
			End Get
		End Property

		#Region "AggregateParameter TearOff's"
		Public class TearOffAggregateParameter

			Public Sub New(ByVal clause As AggregateClause)
				Me._clause = clause
			End Sub
		
	
		Public ReadOnly Property CodCobro() As AggregateParameter
			Get
				Dim where As AggregateParameter = New AggregateParameter(ColumnNames.CodCobro, Parameters.CodCobro)
				Me._clause._entity.Query.AddAggregateParameter(where)
				Return where
			End Get
		End Property

		Public ReadOnly Property FechaCobro() As AggregateParameter
			Get
				Dim where As AggregateParameter = New AggregateParameter(ColumnNames.FechaCobro, Parameters.FechaCobro)
				Me._clause._entity.Query.AddAggregateParameter(where)
				Return where
			End Get
		End Property

		Public ReadOnly Property CodCliente() As AggregateParameter
			Get
				Dim where As AggregateParameter = New AggregateParameter(ColumnNames.CodCliente, Parameters.CodCliente)
				Me._clause._entity.Query.AddAggregateParameter(where)
				Return where
			End Get
		End Property

		Public ReadOnly Property NroRecibo() As AggregateParameter
			Get
				Dim where As AggregateParameter = New AggregateParameter(ColumnNames.NroRecibo, Parameters.NroRecibo)
				Me._clause._entity.Query.AddAggregateParameter(where)
				Return where
			End Get
		End Property

		Public ReadOnly Property Total() As AggregateParameter
			Get
				Dim where As AggregateParameter = New AggregateParameter(ColumnNames.Total, Parameters.Total)
				Me._clause._entity.Query.AddAggregateParameter(where)
				Return where
			End Get
		End Property

		Public ReadOnly Property EstadRecibo() As AggregateParameter
			Get
				Dim where As AggregateParameter = New AggregateParameter(ColumnNames.EstadRecibo, Parameters.EstadRecibo)
				Me._clause._entity.Query.AddAggregateParameter(where)
				Return where
			End Get
		End Property

		Public ReadOnly Property CodCobrador() As AggregateParameter
			Get
				Dim where As AggregateParameter = New AggregateParameter(ColumnNames.CodCobrador, Parameters.CodCobrador)
				Me._clause._entity.Query.AddAggregateParameter(where)
				Return where
			End Get
		End Property

		Public ReadOnly Property CodUsuario() As AggregateParameter
			Get
				Dim where As AggregateParameter = New AggregateParameter(ColumnNames.CodUsuario, Parameters.CodUsuario)
				Me._clause._entity.Query.AddAggregateParameter(where)
				Return where
			End Get
		End Property

		Public ReadOnly Property FechaActualizacion() As AggregateParameter
			Get
				Dim where As AggregateParameter = New AggregateParameter(ColumnNames.FechaActualizacion, Parameters.FechaActualizacion)
				Me._clause._entity.Query.AddAggregateParameter(where)
				Return where
			End Get
		End Property


			Private _clause as AggregateClause
		End Class
		#End Region	

		Public ReadOnly Property CodCobro() As AggregateParameter 
			Get
				If _CodCobro_W Is Nothing Then
					_CodCobro_W = TearOff.CodCobro
				End If
				Return _CodCobro_W
			End Get
		End Property

		Public ReadOnly Property FechaCobro() As AggregateParameter 
			Get
				If _FechaCobro_W Is Nothing Then
					_FechaCobro_W = TearOff.FechaCobro
				End If
				Return _FechaCobro_W
			End Get
		End Property

		Public ReadOnly Property CodCliente() As AggregateParameter 
			Get
				If _CodCliente_W Is Nothing Then
					_CodCliente_W = TearOff.CodCliente
				End If
				Return _CodCliente_W
			End Get
		End Property

		Public ReadOnly Property NroRecibo() As AggregateParameter 
			Get
				If _NroRecibo_W Is Nothing Then
					_NroRecibo_W = TearOff.NroRecibo
				End If
				Return _NroRecibo_W
			End Get
		End Property

		Public ReadOnly Property Total() As AggregateParameter 
			Get
				If _Total_W Is Nothing Then
					_Total_W = TearOff.Total
				End If
				Return _Total_W
			End Get
		End Property

		Public ReadOnly Property EstadRecibo() As AggregateParameter 
			Get
				If _EstadRecibo_W Is Nothing Then
					_EstadRecibo_W = TearOff.EstadRecibo
				End If
				Return _EstadRecibo_W
			End Get
		End Property

		Public ReadOnly Property CodCobrador() As AggregateParameter 
			Get
				If _CodCobrador_W Is Nothing Then
					_CodCobrador_W = TearOff.CodCobrador
				End If
				Return _CodCobrador_W
			End Get
		End Property

		Public ReadOnly Property CodUsuario() As AggregateParameter 
			Get
				If _CodUsuario_W Is Nothing Then
					_CodUsuario_W = TearOff.CodUsuario
				End If
				Return _CodUsuario_W
			End Get
		End Property

		Public ReadOnly Property FechaActualizacion() As AggregateParameter 
			Get
				If _FechaActualizacion_W Is Nothing Then
					_FechaActualizacion_W = TearOff.FechaActualizacion
				End If
				Return _FechaActualizacion_W
			End Get
		End Property

		Private _CodCobro_W As AggregateParameter = Nothing
		Private _FechaCobro_W As AggregateParameter = Nothing
		Private _CodCliente_W As AggregateParameter = Nothing
		Private _NroRecibo_W As AggregateParameter = Nothing
		Private _Total_W As AggregateParameter = Nothing
		Private _EstadRecibo_W As AggregateParameter = Nothing
		Private _CodCobrador_W As AggregateParameter = Nothing
		Private _CodUsuario_W As AggregateParameter = Nothing
		Private _FechaActualizacion_W As AggregateParameter = Nothing

		Public Sub AggregateClauseReset()

		_CodCobro_W = Nothing
		_FechaCobro_W = Nothing
		_CodCliente_W = Nothing
		_NroRecibo_W = Nothing
		_Total_W = Nothing
		_EstadRecibo_W = Nothing
		_CodCobrador_W = Nothing
		_CodUsuario_W = Nothing
		_FechaActualizacion_W = Nothing
			Me._entity.Query.FlushAggregateParameters()

		End Sub
	
		Private _entity As BusinessEntity
		Private _tearOff As TearOffAggregateParameter
    End Class	

	Public ReadOnly Property Aggregate() As AggregateClause
		Get
			If _aggregateClause Is Nothing Then
				_aggregateClause = New AggregateClause(Me)
			End If
	
			Return _aggregateClause
		End Get
	End Property
	
	Private _aggregateClause As AggregateClause = Nothing	
#End Region	

	Protected Overrides Function GetInsertCommand() As IDbCommand
	
		Dim cmd As SqlCommand = New SqlCommand
		cmd.CommandType = CommandType.StoredProcedure
		cmd.CommandText = "[" + Me.SchemaStoredProcedure + "proc_COBROSInsert]" 
	    
		CreateParameters(cmd)
		
		Dim p As SqlParameter
		p = cmd.Parameters(Parameters.CodCobro.ParameterName)
		p.Direction = ParameterDirection.Output
    
		Return cmd 

  	End Function
	
	Protected Overrides Function GetUpdateCommand() As IDbCommand
	
		Dim cmd As SqlCommand = New SqlCommand
		cmd.CommandType = CommandType.StoredProcedure    
		cmd.CommandText = "[" + Me.SchemaStoredProcedure + "proc_COBROSUpdate]" 
		
		CreateParameters(cmd) 
		    
		Return cmd
	
	End Function	
	
	Protected Overrides Function GetDeleteCommand() As IDbCommand
	
		Dim cmd As SqlCommand = New SqlCommand
		cmd.CommandType = CommandType.StoredProcedure    
		cmd.CommandText = "[" + Me.SchemaStoredProcedure + "proc_COBROSDelete]" 
		
		Dim p As SqlParameter
		p = cmd.Parameters.Add(Parameters.CodCobro)
		p.SourceColumn = ColumnNames.CodCobro
		p.SourceVersion = DataRowVersion.Current

  
		Return cmd
	
	End Function	
	
	Private Sub CreateParameters(ByVal cmd As SqlCommand)
	
		Dim p As SqlParameter
		p = cmd.Parameters.Add(Parameters.CodCobro)
		p.SourceColumn = ColumnNames.CodCobro
		p.SourceVersion = DataRowVersion.Current

		p = cmd.Parameters.Add(Parameters.FechaCobro)
		p.SourceColumn = ColumnNames.FechaCobro
		p.SourceVersion = DataRowVersion.Current

		p = cmd.Parameters.Add(Parameters.CodCliente)
		p.SourceColumn = ColumnNames.CodCliente
		p.SourceVersion = DataRowVersion.Current

		p = cmd.Parameters.Add(Parameters.NroRecibo)
		p.SourceColumn = ColumnNames.NroRecibo
		p.SourceVersion = DataRowVersion.Current

		p = cmd.Parameters.Add(Parameters.Total)
		p.SourceColumn = ColumnNames.Total
		p.SourceVersion = DataRowVersion.Current

		p = cmd.Parameters.Add(Parameters.EstadRecibo)
		p.SourceColumn = ColumnNames.EstadRecibo
		p.SourceVersion = DataRowVersion.Current

		p = cmd.Parameters.Add(Parameters.CodCobrador)
		p.SourceColumn = ColumnNames.CodCobrador
		p.SourceVersion = DataRowVersion.Current

		p = cmd.Parameters.Add(Parameters.CodUsuario)
		p.SourceColumn = ColumnNames.CodUsuario
		p.SourceVersion = DataRowVersion.Current

		p = cmd.Parameters.Add(Parameters.FechaActualizacion)
		p.SourceColumn = ColumnNames.FechaActualizacion
		p.SourceVersion = DataRowVersion.Current


	End Sub	

End Class

End NameSpace

